<?php

namespace sample\controller\fb;

use pmvc\mvc\security\SecurityUtil;
use pmvc\mvc\controller\BaseController;
use pmvc\mvc\Request;
use pmvc\mvc\Response;

class CanvasController
	extends BaseController {

	private $facebookAppId;
	private $facebookPermissions;
	private $facebookAuthorizePath;

	public function handleRequest(Request $request, Response $response) {
		$response->getModel()->merge(Array(
			"facebookAppId"			=> $this->facebookAppId,
			"facebookPermissions"	=> $this->facebookPermissions,
			"facebookAuthorizeUrl"	=> $request->getBaseUrl().$this->facebookAuthorizePath
		));
		return parent::getDefaultViewName();
	}

	public function setFacebookAppId($facebookAppId) {
		$this->facebookAppId = $facebookAppId;
	}

	public function setFacebookPermissions($facebookPermissions) {
		$this->facebookPermissions = $facebookPermissions;
	}

	public function setFacebookAuthorizePath($facebookAuthorizePath) {
		$this->facebookAuthorizePath = $facebookAuthorizePath;
	}

}

?>